package Sequence::Infinite::Map;
use base 'Sequence::Infinite';

sub new {
    my( $class, $bool_filter_subref, $sequence ) = @_;
    my $this = $class->SUPER::new();
    
    $this->{sequence} = $sequence;
    $this->{filter} = $bool_filter_subref;
    
    $this;
}

sub increment {
    my( $this ) = @_;
    $_ = $this->{sequence}->increment;
    $this->{filter}->();
}

1;
